package com.zx.commonsms.util;

import java.util.UUID;

/**
 * @author zxkj-admin
 *
 */
public class NonceUtil {

	/**
	 * 通过UUID生成32位nonce的方法
	 * @return
	 */
	public static String generateNonce(){
		UUID id = UUID.randomUUID();//生成带连接符的36位UUID
		String idstr = id.toString();
		String[] ids = idstr.split("-");//去掉UUID中的4个连接符
		StringBuilder sb = new StringBuilder();
		for(String str:ids){
			sb.append(str);
		}
		return sb.toString();
	}
}
